<!DOCTYPE>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <script src="lib/jquery/jquery.js"></script>
    <script src="js/getAllPhotos.js"></script>


    <script>
        /**
         * This is the bootstrap / app script
         */

        // wait for DOM and facebook auth
        var docReady = $.Deferred();
        var facebookReady = $.Deferred();

        $(document).ready(docReady.resolve);

        window.fbAsyncInit = function() {
            FB.init({
                appId      : '758110410904505',
//                channelUrl : '//conor.lavos.local/channel.html',
                status     : true,
                cookie     : true,
                xfbml      : true
            });
            facebookReady.resolve();
        };

        $.when(docReady, facebookReady).then(function() {
            if (typeof main !== 'undefined') {
                main( function( photos, profile ) {
                    console.log( profile );
                    console.log( photos.length );
                    console.log( photos );
                });
            }
        });

        // call facebook script
        (function(d){
            var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
            js = d.createElement('script'); js.id = id; js.async = true;
            js.src = "http://connect.facebook.net/en_US/all.js";
            d.getElementsByTagName('head')[0].appendChild(js);
        }(document));

    </script>
</head>
<body>
<div id="fb-root"></div>
</body>
</html>